package com.example.java_chatroom_redis_rabbitmq.mapper;

import com.example.java_chatroom_redis_rabbitmq.model.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {
    @Select("select * from user where userName=#{userName}")
    User queryUserByUserName(@Param("userName") String userName);

    @Insert("insert into user(userName,password,image,tag) values(#{userName},#{password},#{image},#{tag})")
    Integer addUser(@Param("userName") String userName,@Param("password") String password,@Param("image") String image,@Param("tag") String tag);

    @Select("select * from user where userId=#{userId}")
    User queryUserByUserId(@Param("userId") Integer userId);

    @Update("update user set tag=#{tag} where userId=#{userId}")
    Integer updateUserTag(@Param("UserId") Integer userId,@Param("tag") String tag);
}
